package com.kmxd.ams.infra.search.entity;

import cn.easyes.annotation.HighLight;
import cn.easyes.annotation.IndexField;
import cn.easyes.annotation.IndexName;
import cn.easyes.annotation.rely.Analyzer;
import cn.easyes.annotation.rely.FieldType;
import com.kmxd.ams.core.common.constant.Constants;
import java.io.Serializable;
import lombok.Data;

/**
 * 电子文件表
 *
 * @author ZuoLG
 * @since 2022-07-25
 */
@Data
@IndexName
public class EFileRecordEs implements Serializable {

  private static final long serialVersionUID = 1L;

  /** 主键ID */
  @IndexField(fieldType = FieldType.KEYWORD)
  private Long id;

  /** 文件名 */
  @IndexField(
      fieldType = FieldType.TEXT,
      analyzer = Analyzer.IK_SMART,
      searchAnalyzer = Analyzer.IK_MAX_WORD)
  @HighLight(preTag = Constants.ES_HIGHLIGHT_PRE_TAG, postTag = Constants.ES_HIGHLIGHT_POST_TAG)
  private String title;

  /** 文件名 */
  @IndexField(fieldType = FieldType.KEYWORD)
  @HighLight(preTag = Constants.ES_HIGHLIGHT_PRE_TAG, postTag = Constants.ES_HIGHLIGHT_POST_TAG)
  private String titleKw;

  /** OCR识别内容 */
  @IndexField(
      fieldType = FieldType.TEXT,
      analyzer = Analyzer.IK_SMART,
      searchAnalyzer = Analyzer.IK_MAX_WORD)
  @HighLight(preTag = Constants.ES_HIGHLIGHT_PRE_TAG, postTag = Constants.ES_HIGHLIGHT_POST_TAG)
  private String ocrContent;

  /** OCR识别内容 */
  @IndexField(fieldType = FieldType.KEYWORD)
  @HighLight(preTag = Constants.ES_HIGHLIGHT_PRE_TAG, postTag = Constants.ES_HIGHLIGHT_POST_TAG)
  private String ocrContentKw;

  @IndexField(fieldType = FieldType.KEYWORD)
  private String size;

  @IndexField(fieldType = FieldType.KEYWORD)
  private String ext;
}
